import request from '@/utils/request.js'

export function deleteFile(file_id) {
  return request({
    url: '/upload/file-delete',
    method: 'post',
    data: {file_id}
  })
}

/**
 * @param {File} file
 */
export function httpUploadFile(file) {
  const form = new FormData()
  form.append('file', file)
  return request({
    url: '/upload/image',
    method: 'post',
    transformRequest: [function () {
      return form
    }]
  })
}